package com.lancoo.examview.exam;

import android.os.Bundle;
import android.util.Log;

import androidx.annotation.Nullable;
import androidx.appcompat.app.AppCompatActivity;
import androidx.recyclerview.widget.LinearLayoutManager;
import androidx.recyclerview.widget.RecyclerView;

import com.lancoo.examview.PracticeItemAdapter;
import com.lancoo.examview.R;

import java.util.ArrayList;
import java.util.Arrays;
import java.util.List;

/**
 * Created by pengmi on 2022/2/21 16:32
 * Description:试卷类型数据界面
 */
public class ExamTypeActivity extends AppCompatActivity {

    private long subTime;

    private final String[] paperDataArray = {"2023/英专全题型.json","2023/全题型.json","2023/tk.json","2023/商务英语全题型v1.0.txt","2023/篇章翻译没有高亮.json",
            "2023/11.27新增.json","202212/导入试卷-夸张B.json","202212/导入试卷-夸张A.json",
            "202212/导入试卷AA.json","202212/导入试卷-导语为空.json","202212/导入试卷(1).json","202212/导入试卷1206.json",
            "202212/导入试卷.json","202212/导入试卷听力题.json","图片异常.json", "aa.json",
            "20221101.json", "改错题导语显示混乱.json", "改错题问题数据.json", "考辅乱序.json",
            "完型填空定位问题.json", "答题卡.json",
            "作文题参考答案缩进问题.json", "改错题显示有问题.json",
            "跳转.json", "高职B标准7.15（卷二）.json", "听力两道7.15（卷二）.json",
            "非听力二道7.15（卷一）.json", "高职B_1.json", "各小题的分值不一致.json",
            "考试中学.json", "高职B.json", "听力1道（卷一）.json", "非听力一道（卷一）.json",
            "lh.json", "ly.json", "非听力2道（卷一）.json", "专四.json", "专八.json", "AI考试测试数据1.json",
            "口语.json", "AI考试测试数据2.json", "口语-成绩查看.json", "听力填空+改错.json", "成绩测试.json", "客观题.json", "主观题.json",
            "答题卡.json", "20220402测试数据.json", "20220406.json", "改错题出问题的试卷.json", "中学新增题型.json"};

    @Override
    protected void onCreate(@Nullable Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.activity_exam_type);
        Log.e("task","ExamTypeActivity:onCreate");
        RecyclerView recyclerView=findViewById(R.id.recycler_view);
        recyclerView.setLayoutManager(new LinearLayoutManager(this));
        List<String> list = new ArrayList<>(Arrays.asList(paperDataArray));
        PracticeItemAdapter practiceItemAdapter=new PracticeItemAdapter(list);
        practiceItemAdapter.setOnCallBack(paperName -> gotoExamActivity(paperName,0));
        recyclerView.setAdapter(practiceItemAdapter);

    }

    private void gotoExamActivity(String jsonFileName,int trainSence){
        if(System.currentTimeMillis()-subTime<200){
            return;
        }
        subTime=System.currentTimeMillis();
        ExamActivity.launch(ExamTypeActivity.this,jsonFileName,trainSence);
    }




}

